Label:Processing of date and time data.(1) String date ' 20080301 ', which is a string date, but must be guaranteed as a four-bit year, two-bit month, and two-bit date. For example, the Query order table date is greater than ' 20080301 '. It can be written like this: 1 SELE
.exists Find out that the CategoryID in the category table are not equal to N.categoryid C.categoryid,c.[name] First query statement: Select C.categoryid,c.[name] from Category C left join News N in C.categoryid=n.categoryid where N.categoryid is Null Second query statement: Select Categoryid,[name] from category where NOT exists ( SELECT * FROM News where Category.categoryid=news.categoryid ) * The first performance is undoubtedly the best when the CategoryID is not repeated in the news table,
N.categoryid C.categoryid,c.[name]First query statement: Select C.categoryid,c.[name] from Category C left join News N in C.categoryid=n.categoryid where N.categoryid is NullSecond query statement: Select Categoryid,[name] from category where NOT exists(SELECT * FROM News where Category.categoryid=news.categoryid)* The first performance is undoubtedly the best when the CategoryID is not repeated in the news table, whereas the second performance is good.11.SQL Statement conversion Format functio
Tags: ar sp strong data on the art code BSDatabase (string function, Date function, data type conversion Cast,convert)Use studentGoCREATE TABLE Yuangong(code int,Name varchar (20),Sex varchar (20),Age int,Bumen varchar (20),)INSERT into Yuangong values (1, ' Week number ', ' Male ', 27, ' sales Department ')INSERT into Yuangong values (1, ' King of the Week ', ' Male ', 27, ' sales Department ')INSERT into
A long time did not write blog, not lazy, it is recently my visit speed is not good, with Firefox often can't upload pictures ....I didn't mean to find out today. SQL Server Datetime Cast to Date type you can use the index to share:Test environment:Use TEMPDBGOCREATE TABLE TB(ID INT IDENTITY (PRIMARY KEY),NAME VARCHAR (200),OPTIME DATETIME DEFAULT GETDATE ())GODECLARE @i INT = 1While @iBEGININSERT into TB (
days and months, these two issues are resolved.
A number of time functions have been listed in the previous article, and now the cast and convert used in this article are described in detail:
Let's take a look at their grammar:
CAST (expression as data_type [(length)])
CONVERT (data_type [(length)], expression [, style])
which
Expression: Any valid expression.
Data_type: Target data type. This include
SQL group and told me to set the time format, then, the time format is limited to days and months, and the two problems are solved.
I have listed multiple time functions in the previous article. Now I will introduce the CAST and CONVERT used in this article in detail:
Let's take a look at their syntax:
CAST (expression AS data_type [(length)])CONVERT (data_type [(length)], expression [, style])
Where:
Expr
group and told me to set the time format, then, the time format is limited to days and months, and the two problems are solved.I have listed multiple time functions in the previous article. Now I will introduce the CAST and CONVERT used in this article in detail:Let's take a look at their syntax:CAST (expression AS data_type [(length)])CONVERT (data_type [(length)], expression [, style])Where:Expression: Any valid expression.Data_type: Target data ty
Section - class - database Development and ADOAggregation Functions , Fuzzy Query Like , wildcard characters . Null value processing . Order by Sort . Grouping group by-having. Type Conversions -cast,convert.union All; Select column into new table ; String Functions ; Date FunctionSQL aggregate functionsMax (max), min (min), AVG (average), SUM (and), Count (Qty: Number of records)The aggregate function is
Prior to if you prefer to get experience to transform made the effort diesel-engined keep a eye on and you'll have a to Wo RK out in which targeted selection or possibly device.Already diesel-engined keep an eye on all the convert effort ways really is somewhere around gkfx Diesel women ' s Watche s right to clockwork devices and additionally quartz keep an eye onDiesel-engined Clockwork DevicesGrab a fabulous computer file certainly is the color of the workweek and additionally
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.